package powtorka.swing;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class PanelGraficzny extends JFrame {
	public class PanelRysowania extends JPanel {
		private static final long serialVersionUID = 939982189886953282L;

		@Override
		public void paintComponent(Graphics g){
			Graphics2D g2d = (Graphics2D) g;
			g2d.setColor(Color.YELLOW);
			g2d.fillRect(0, 0, 200, 100);
			g2d.setColor(Color.BLUE);
			g2d.fillOval(20, 20, 15, 15);
		}
	}

	private static final long serialVersionUID = 4940459408230669048L;

	public PanelGraficzny(){
		super("To jest okienko graficzne");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(320, 200);
		add(new PanelRysowania());
		setLocationRelativeTo(rootPane);
		repaint();
		setVisible(true);
	}

}
